package com.abel.demo.controller;

import com.abel.demo.anno.Decrypt;
import com.abel.demo.common.Resp;
import com.abel.demo.controller.params.IndexParam;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

/**
 * Author: Abel.lin
 * Date: Created in 2018/5/31 15:49
 * Copyright: Copyright (c) 2017
 * Description:
 */
@Slf4j
@RestController
public class IndexController {
    @GetMapping("test1")
    public Resp index(@RequestParam("id")String id){
        log.info("id;{}", id);
        return Resp.ok("hello word=>" + id);
    }

    @Decrypt
    @PostMapping("test2")
    public Resp test2(@RequestBody IndexParam param){
        return Resp.ok(param);
    }

    @PostMapping("test3")
    public Resp test3(@RequestBody IndexParam param){
        return Resp.ok(param);
    }



}
